#include "stdafx.h"
#include "other.h"

#include <windows.h>
#include <shlobj.h>

int CALLBACK BrowseForFolderCallback(HWND hwnd,UINT uMsg,LPARAM lp, LPARAM pData)
{
	char szPath[MAX_PATH];
	
	switch(uMsg)
	{
	case BFFM_INITIALIZED:
		SendMessage(hwnd, BFFM_SETSELECTION, TRUE, pData);
		break;
		
	case BFFM_SELCHANGED: 
		if (SHGetPathFromIDList((LPITEMIDLIST) lp ,szPath)) 
		{
			SendMessage(hwnd, BFFM_SETSTATUSTEXT,0,(LPARAM)szPath);
			
		}
		break;
	}
	
	return 0;
}